package com.hpf.redis7.controller;

import com.hpf.redis7.service.InventoryService;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
//(tags = "redis分布式锁测试")
public class InventoryController {
    @Resource
    private InventoryService inventoryService;

    //("扣减库存，一次卖一个")
    @GetMapping(value = "/inventory/sale")
    public String sale() {
        return inventoryService.sale70();
    }

    //("扣减库存saleByRedisson，一次卖一个")
    @GetMapping(value = "/inventory/saleByRedisson")
    public String saleByRedisson() {
        return inventoryService.saleByRedisson();
    }


}

